#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	char a[100];
	int i=0;
	while(scanf("%c",&a[i])&&a[i]!='\n')
	i++;
	for(i=0;i<strlen(a);i++)
	{
		if('a'<=a[i]&&a[i]<='z')
		a[i]=a[i]-32;
		else if('A'<=a[i]&&a[i]<='Z')
		a[i]=a[i]+32;
	}
	cout<<a;
    return 0;
}
